// 加载 kml 文件格式的资源
viewer.dataSources.add(Cesium.KmlDataSource.load("../test99.kml")).then(data => {
  viewer.flyTo(data, { duration: 0.8, offset: new Cesium.HeadingPitchRange(0, -90, 0) });
  // viewer.zoomTo(data, new Cesium.HeadingPitchRange(0, -90, 0));
  data.entities.values.forEach(item => {
    if (item.polygon) {
      item.polygon = new Cesium.PolygonGraphics({
        hierarchy: item.polygon.hierarchy,
        material: Cesium.Color.fromCssColorString('blue').withAlpha(0.1),
      })
      item.polyline = new Cesium.PolylineGraphics({
        positions: item.polygon.hierarchy._value.positions,
        material: Cesium.Color.fromCssColorString('blue').withAlpha(0.5),
        clampToGround: true,
        width: 3,
      });
    } else if (item.polyline) {
      item.polyline = new Cesium.PolylineGraphics({
        positions: item.polyline.positions,
        material: Cesium.Color.fromCssColorString('blue').withAlpha(0.5),
        clampToGround: true,
        width: 3,
      });
    }
  });
});